//
// Created by linyongzhi on 2023/12/12.
//

#include "CPHBufferQueue.h"

bool CPHBufferQueue::IsQueueEmpty() {
    std::lock_guard<std::mutex> lockGuard(mutex);
    return bufferQueue.empty();
}

CPHBuffer CPHBufferQueue::GetNextData() {
    std::lock_guard<std::mutex> lockGuard(mutex);
    CPHBuffer bufferData = bufferQueue.front();
    bufferQueue.pop();
    return bufferData;
}

void CPHBufferQueue::pushData(CPHBuffer &bufferData) {
    std::lock_guard<std::mutex> lockGuard(mutex);
    bufferQueue.push(bufferData);
}

CPHBufferQueue::CPHBufferQueue() {}

CPHBufferQueue::~CPHBufferQueue() {

}
